package com.example.service.impl;

import java.util.Arrays;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.example.dao.UserDao;
import com.example.model.User;
import com.example.model.query.UserExample;
import com.example.service.UserService;


/**
 * Created on 2017/12/26 18:50
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
	private UserDao userDao;

    @Transactional(readOnly = true)
    public User selectByPrimaryKey(Long id) {
        return userDao.selectByPrimaryKey(id);
    }

	@Transactional(readOnly = true)
	public List<User> selectByExample(UserExample q) {
		return userDao.selectByExample(q);
	}

	@Transactional
	public Object insert(User t) {
		return userDao.insert(t);
	}

	@Transactional
	public Object insertSelective(User t) {
		return userDao.insertSelective(t);
	}

	@Transactional
	public Object updateByPrimaryKeySelective(User t) {
		return userDao.updateByPrimaryKeySelective(t);
	}

	@Transactional
	public Object updateByExampleSelective(User t, UserExample q) {
		return userDao.updateByExampleSelective(t, q);
	}

	@Transactional
	public Object updateByExample(User t, UserExample q) {
		return userDao.updateByExample(t, q);
	}

    @Transactional
    public Object updateByPrimaryKey(User t) {
        return userDao.updateByPrimaryKey(t);
    }

	@Transactional(readOnly = true)
	public Long countByExample(UserExample q) {
		return userDao.countByExample(q);
	}

    @Transactional
    public Integer deleteByPrimaryKey(Long id) {
        return userDao.deleteByPrimaryKey(id);
    }



	@Transactional
	public Integer deleteByExample(UserExample q) {
		return userDao.deleteByExample(q);
	}

}
